#!/usr/bin/perl
use File::Recurse;
use File::Copy;

my $dir= 'C:\Users\Mike\documents\wwcom\v3.0\emails';

for my $file (<$dir/*.txt>) {
	print "Processing: $file\n";

	copy($file,"$file.old");

	open(FID,$file);
	my $s= join('',<FID>);
	close(FID);

	$s =~ s/\$([^\$]*?)\$/<TMPL_VAR NAME=$1>/g;
	open(FID,">$file");
	print FID $s;
	close(FID);

#	print $s;

#	exit(0);
}
